﻿using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.Xna.Framework.Graphics;

namespace RoboTrocity {
	class TerrainSlope : Terrain {

		float slope;

		public TerrainSlope() : this(1.0f) {
			
		}

		public TerrainSlope(float _slope) {
			slope = _slope;
		}

		public override void Draw(SpriteBatch sBatch, Camera camera) {
			if (this.Bounds.Right >= camera.Bounds.Left && this.Bounds.Left <= camera.Bounds.Right) {
				if (Slope > 0) {
					this.DispSprite.DrawFrame(sBatch, Position - camera.Origin, ObjectDepth);
				} else {
					this.DispSprite.DrawFrame(sBatch, Position - camera.Origin, ObjectDepth, true);
				}

			}
		}

		public float Slope {
			get { return slope; }
			set { slope = value; }
		}

		public override string MapXMLData {
			get {
				String data = "";
				data += "<Slope>\n<Position locX=\"" + Position.X + "\" locY=\"" + Position.Y + "\" />";
				data += "\n<Slope value=\"" + Slope + "\" />\n<Texture name=\"" + DispSprite.ImgLoc + "\" />\n</Slope>\n";
				return data;
			}
		}
	}
}
